<?php
$arrBase=array(
	"027bdqn",
    "3g.accp800.com",
    "3g.benet-wh.cn",
    "accp800",
    "ahsj",
    "app",
    "cn",
    'com',
    'com.cn',
    'dedecms0',
    'hlm',
    'jxsx',
    'm',
    'phpcms0',
    'xi0an',
    'xian'
);
$row=0;
$wall=0;
$pathBase='E:/get_info/';
$re=file_exists($pathBase);
if($re==FALSE){
	mkdir($pathBase);
}
$timeName=date("Y-m-d",time());
if(!(is_dir($pathBase.$timeName))){
	mkdir($pathBase.$timeName);
}
$arrHave=scandir($pathBase.$timeName);
foreach($arrBase as $v){
	if(!(in_array($v.".txt", $arrHave))){
		$arrDir[]=$v;
	}
}
//读取所有
function getdir($path,$pathEnd){
	global $row,$wall,$timeName,$pathBase;
	$arr=scandir($path);
	foreach($arr as $v){
		if($v!="."&&$v!=".."){
			if(is_dir($path."/".$v)){
				$row++;
//				echo $row."、目录：".$path."/".$v."<br>";
				getdir($path."/".$v,$pathEnd);
			}else{
				$row++;
//				echo $row."、文件：".$path."/".$v."<br>";
				$fsize=filesize("$path/$v");
				$handle = fopen($pathBase.$timeName."/".$pathEnd.".txt","a+");
				$fwstr=substr($path."/".$v, 6);
				$w=fwrite($handle, $fwstr.";".$fsize."\n");
				$wall=$wall+$w;
			}
		}
	}
}

if(count($arrDir)>0){
	foreach($arrDir as $v){
		getdir("../../".$v,$v);
		echo $pathBase.$timeName."/".$v.".txt create OK! create：".$wall."<br>";
		$wall=0;
	}
}
?>
